﻿@{
    ViewBag.Title = "Regist";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>Login Page | Amaze UI Example</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="alternate icon" type="image/png" href="~/Content/assets/i/favicon.png">
    <style>
        .header {
            text-align: center;
        }

            .header h1 {
                font-size: 200%;
                color: #333;
                margin-top: 30px;
            }

            .header p {
                font-size: 14px;
            }
    </style>
</head>

<body>
    <div class="am-g">
        <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
            <h1>注册</h1>
            <hr>
            <form action="" class="am-form" id="doc-vld-msg">
                <fieldset>

                    <div class="am-form-group">
                        <label for="doc-vld-name-2-1">用户名：</label>
                        <input name="eName" type="text" id="doc-vld-name-2-1"  data-validation-message="至少3个字符,最多10个字符" placeholder="输入用户名（至少3个字符,最多10个字符）" pattern="^.{3,10}$" required />
                    </div>

                    <div class="am-form-group">
                        <label for="doc-vld-email-2-1">邮箱：</label>
                        <input name="Email" type="email" id="doc-vld-email-2-1" data-validation-message="输入地球上的电子邮箱撒" placeholder="输入邮箱" required />
                    </div>

                    <div class="am-form-group">
                        <label for="doc-vld-pwd-1">密码：</label>
                        <input name="Pwd" type="password" class="" id="doc-vld-pwd-1" placeholder="输入密码(至少6位,最多10位)" pattern="^.{6,10}$" data-validation-message="输入密码(至少6位,最多10位)" required />
                    </div>

                    <div class="am-form-group">
                        <label for="doc-vld-pwd-2">确认密码：</label>
                        <input type="password" id="doc-vld-pwd-2" placeholder="请与上面输入的值一致" data-equal-to="#doc-vld-pwd-1" data-validation-message="两次输入密码不同哦~" required />
                    </div>

                    <button class="am-btn am-btn-secondary btn-loading-example" style="margin-top: 4%;" id="submit" type="button">提交</button>
                </fieldset>
            </form>
            <hr>
            <p>© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
        </div>
    </div>
</body>

</html>
<script type="text/javascript" src="~/Content/assets/js/jquery.min.js"></script>
<script src="~/Content/assets/js/amazeui.min.js"></script>
<script src="~/Content/js/yanzheng.js"></script>
<script type="text/javascript">
    function Loading(obj) {
        var $btn = obj;
        $btn.button('loading');
        setTimeout(function () {
            $btn.button('reset');
        }, 5000);
    }
    $(function () {
        $("#submit").click(function () {
            $.ajax({
                type: 'post',
                url: '@Url.Action("RegistSub", "User")',
                data: { eName: $("input[name='eName']").val(), Email: $("input[name='Email']").val(), Pwd: $("input[name='Pwd']").val() },
                cache: false,
                dataType: 'json',
                before: Loading($(this)),
                success: function (data) {
                    AjaxSuccess(data);
                }
            });
        });
    });
</script>
